home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sol_ctrlrmdoor.cog < prev    next >
Text File  |  1999-11-15  |  6KB  |  223 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SOL_CtrlRmDoor.cog
  4. #
  5. # Indy enters the control room for the first time and checks out Horner's operation.
  6. #
  7. # [TRM]
  8. #
  9. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols        
  13.     
  14.     message     activate
  15.  
  16.     thing       player          local
  17.     
  18.     thing        door
  19.     thing       indy            # actor indy
  20.     thing       cam1
  21.     thing       walkTarg1       # Walk to this when door opens
  22.     thing       lookTarg1       # look at this while walking into room
  23.     thing       lookTarg2       # Look at this and turn towards it
  24.     thing       walkTarg2       # take a step towards the ctrl panel
  25.     
  26.     thing       camTarg
  27.         
  28.     sound       inSay1=Inxj146.wav      local       # hmmm...
  29.     sound       inSay2=Sl02j01.wav      local       # horner's little...
  30.     sound       inSay3=Sl02j03.wav      local       # I'll bet...
  31.     sound       inSay4=Sl02j02.wav      local       # But without...
  32.     sound       in_Nope=Inxj088.wav     local       # nope
  33.     
  34.     template    tplActor=indy_sh_actor              local
  35.     
  36.     keyframe    inStand1=0in_stand4.key                 local
  37.     keyframe    inThinking=0in_thinking_4_4.key         local
  38.     keyframe    inStand2=0in_stand1_bd_4.key            local
  39.     keyframe    inLeft=in_activate_medium_left.key      local
  40.     
  41.     cog         hintCog
  42.     
  43.     int         open=0      local
  44.     int         inTrack     local
  45.     int         tempCam     local
  46.     int         pauseSnd    local
  47.     int         curCam      local
  48.     int         playing=0   local
  49.     
  50.     # ** Subroutines **
  51.     flex        playcut     local
  52.  
  53. end
  54.  
  55. # ========================================================================================
  56.  
  57. code
  58.  
  59. activate:
  60.  
  61.     player = GetLocalPlayerThing();
  62.     curCam = GetCurrentCamera();
  63.     
  64.     if((GetSenderRef() == door) && (GetCurItem(player) > 0) && (open == 0) && (playing == 0))
  65.     {
  66.         playing = 1;
  67.         
  68.         # do cutscene stuff
  69.         MakeMeStop();
  70.         StartCutscene(0);
  71.         
  72.         # nudge the door
  73.         PlayMode(player, 60, 0);
  74.         Sleep(0.3);
  75.             
  76.         PlayVoice(player, in_Nope, 1.0, 1);
  77.         
  78.         # Return control to player
  79.         ClearActorFlags(player, 0x200000);
  80.         EndCutscene();
  81.         
  82.         playing = 0;
  83.     }
  84.  
  85.     else if((GetSenderRef() == door) && (open == 0))
  86.     {    
  87.         # if player has lighter out
  88.         if(GetCurWeapon(player) == 13)
  89.         {
  90.             open = 1;
  91.             
  92.             # do cutscene stuff
  93.             MakeMeStop();
  94.             StartCutscene(1);
  95.             
  96.             # nudge the door with left hand
  97.             PlayKey(player, inLeft, 4, 0x12, 1);
  98.             Sleep(0.5);
  99.             
  100.             # put away the lighter
  101.             DeselectWeapon(player);
  102.             DeselectWeaponWait(player);
  103.             
  104.             Call playcut;
  105.         }
  106.         
  107.         # normal activation
  108.         else if(GetCurWeapon(player) == 0)
  109.         {
  110.             open = 1;
  111.             
  112.             # wait for weapon to be put away
  113.             DeselectWeaponWait(player);
  114.             
  115.             # do cutscene stuff
  116.             MakeMeStop();
  117.             StartCutscene(1);
  118.             
  119.             # nudge the door
  120.             PlayMode(player, 60, 0);
  121.             Sleep(0.5);
  122.             
  123.             Call playcut;
  124.         }
  125.     }
  126.     
  127.     return;
  128.  
  129. # ========================================================================================
  130.  
  131. playcut:
  132.  
  133.     Sleep(0.5);
  134.     
  135.     # solve hint1
  136.     SendMessage(hintCog, user0);
  137.     
  138.     # switch to camera inside room
  139.     SetCameraFocus(2, Cam1);
  140.     SetCameraSecondaryFocus(2, camTarg);
  141.     SetCurrentCamera(2);
  142.     
  143.     # outfit Indy actor
  144.     CopyPlayerHolsters(player, indy);
  145.     
  146.     # hide player show actor
  147.     SetThingFlags(player, 0x80000);
  148.     ClearThingFlags(indy, 0x80000);
  149.     
  150.     # open the door
  151.     Rotate(door, -90, 1, 2.0);
  152.     WaitForStop(door);
  153.     
  154.     # walk actor to the levers
  155.     AISetMoveSpeed(indy, 1.0);
  156.     AISetLookThing(indy, lookTarg1);
  157.     AISetMoveThing(indy, walkTarg1, 0);
  158.     Sleep(1.5);
  159.     
  160.     MoveToFrame(cam1, 1, 0.45);
  161.     MoveToFrame(camTarg, 1, 1.9);
  162.     AIWaitForStop(indy);
  163.     Sleep(0.5);
  164.     
  165.     MoveToFrame(cam1, 2, 0.5);
  166.     
  167.     # indy speaks as the camera moves around him
  168.     inTrack = PlayKey(indy, inStand1, 2, 0x0, 0);
  169.     PlayKey(indy, inStand2, 4, 0x12, 1);
  170.     #PlaySoundLocal(inSay1, 1.0, 0.0, 0x0, 1);
  171.     PlayVoice(indy, inSay1, 1.0, 1);
  172.     #PlaySoundLocal(inSay2, 1.0, 0.0, 0x0, 0);
  173.     PlayVoice(indy, inSay2, 1.0, 1);
  174.     PlayKey(indy, inThinking, 4, 0x12, 0);
  175.     pauseSnd = GetSoundLen(inSay2);
  176.     Sleep(pauseSnd+0.5);
  177.     #PlaySoundLocal(inSay3, 1.0, 0.0, 0x0, 1);
  178.     PlayVoice(indy, inSay3, 1.0, 1);
  179.     StopKey(indy, inTrack, 0.5);
  180.     Sleep(0.6);
  181.     
  182.     #MoveToFrame(camTarg, 2, 1.1);
  183.     
  184.     # actor turns towards the panel and takes a step
  185.     SetThingMaxRotVel(indy, 150.0);
  186.     AISetLookThing(indy, lookTarg2);
  187.     Sleep(1.2);
  188.     
  189.     #SetCameraFOV(70, 1, 1.2);
  190.     
  191.     AISetMoveThing(indy, walkTarg2, 0);
  192.     PlayVoice(indy, inSay4, 1.0, 1);
  193.     #PlaySoundLocal(inSay4, 1.0, 0.0, 0x0, 1);
  194.     
  195.     Sleep(1.0);
  196.     
  197.     # Get the player into position
  198.     CopyOrientAndPos(indy, player);
  199.     
  200.     # stop any unfinished animations
  201.     ResetThing(player);
  202.     
  203.     # hide actor show player
  204.     SetThingFlags(indy, 0x80000);
  205.     ClearThingFlags(player, 0x80000);
  206.     
  207.     # Return control to player
  208.     ClearActorFlags(player, 0x200000);
  209.     
  210.     # return camera to player
  211.     SetCameraPosition(curcam, GetThingPos(cam1));
  212.     #SetCameraFOV(90, 0, 0.0);
  213.     SetCurrentCamera(curCam);
  214.     
  215.     EndCutscene();   
  216.  
  217.     return;
  218.  
  219. # ========================================================================================
  220.     
  221. end
  222.  
  223.